# -*- coding: utf-8 -*-
# @Time: 2021/5/15 9:05
# @Author: moxinqian
# @Contact: tel 18382469064
# @File: demo-selenium-change-title.py
# @DESC: 修改title
from selenium import webdriver
from time import sleep

#主站
host = "http://www.baidu.com"

#配置项
options = webdriver.FirefoxOptions()
#静默的方式打开浏览器
options.add_argument("--headless")
driver = webdriver.Firefox(executable_path="firefox_driver/geckodriver_28.exe",firefox_options=options)


# 进入链接
driver.get(host)
sleep(3)
print(driver.title)

#修改title
driver.execute_script('document.title = "百度一下，知道了"')
print(driver.title)
